package com.cims.bo.staff;

import java.util.List;

import com.cims.common.exception.BoException;
import com.cims.common.vo.Staff;
import com.cims.dao.staff.StaffDAO;
import com.cims.dao.staff.StaffDAOImpl;

public class StaffBOImpl implements StaffBO {
	
	StaffDAO dao = new StaffDAOImpl();
	
	@Override
	public int authenticate(String username, String password){
		try{
			return dao.authenticate(username, password);
		}catch(Exception ex){
			System.out.println(ex.getMessage());
			return -1;
		}
	}

	
	@Override
	public List<Staff> getListStaff() throws BoException {
		try {
			return dao.getListStaff();
		} catch (Exception e) {
			// TODO: handle exception
		}
		return null;
	}

	@Override
	public Staff findByStaffId(int staffId) throws BoException {
		try {
			return dao.findByStaffId(staffId);
		} catch (Exception e) {
			// TODO: handle exception
		}
		return null;
	}

	@Override
	public boolean update(Staff sta) throws BoException {
		try {
			return dao.update(sta);
		} catch (Exception e) {
			// TODO: handle exception
		}
		return false;
	}

	@Override
	public boolean insert(Staff sta) {
		try {
			return dao.insert(sta);
		} catch (Exception e) {
			// TODO: handle exception
		}
		return false;
	}

	@Override
	public void delete(int staffId) throws BoException {
		try {
			dao.delete(staffId);
		} catch (Exception e) {
			// TODO: handle exception
		}

	}


	

	

}
